home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Advanced W250988222001.psc / WebServer.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-08-22  |  65.7 KB  |  2,033 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  4. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  5. Begin VB.Form WebServer 
  6.    Caption         =   "WebServer 1.2"
  7.    ClientHeight    =   5295
  8.    ClientLeft      =   3150
  9.    ClientTop       =   1200
  10.    ClientWidth     =   4860
  11.    Icon            =   "WebServer.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   5295
  14.    ScaleWidth      =   4860
  15.    Begin VB.Frame Frame4 
  16.       Height          =   3675
  17.       Left            =   60
  18.       TabIndex        =   40
  19.       Top             =   540
  20.       Visible         =   0   'False
  21.       Width           =   4695
  22.       Begin VB.CommandButton Command18 
  23.          Caption         =   "X"
  24.          Height          =   195
  25.          Left            =   4440
  26.          TabIndex        =   63
  27.          Top             =   60
  28.          Width           =   195
  29.       End
  30.       Begin VB.PictureBox Picture1 
  31.          AutoRedraw      =   -1  'True
  32.          BackColor       =   &H00800000&
  33.          FillColor       =   &H00FFFFFF&
  34.          BeginProperty Font 
  35.             Name            =   "MS Sans Serif"
  36.             Size            =   8.25
  37.             Charset         =   0
  38.             Weight          =   700
  39.             Underline       =   0   'False
  40.             Italic          =   0   'False
  41.             Strikethrough   =   0   'False
  42.          EndProperty
  43.          ForeColor       =   &H8000000E&
  44.          Height          =   315
  45.          Left            =   0
  46.          ScaleHeight     =   255
  47.          ScaleWidth      =   4635
  48.          TabIndex        =   69
  49.          Top             =   0
  50.          Width           =   4695
  51.       End
  52.       Begin TabDlg.SSTab SSTab1 
  53.          Height          =   3315
  54.          Left            =   60
  55.          TabIndex        =   41
  56.          Top             =   360
  57.          Width           =   4575
  58.          _ExtentX        =   8070
  59.          _ExtentY        =   5847
  60.          _Version        =   327681
  61.          TabHeight       =   520
  62.          TabCaption(0)   =   "IPs"
  63.          TabPicture(0)   =   "WebServer.frx":030A
  64.          Tab(0).ControlEnabled=   -1  'True
  65.          Tab(0).Control(0)=   "Label9"
  66.          Tab(0).Control(0).Enabled=   0   'False
  67.          Tab(0).Control(1)=   "Label10"
  68.          Tab(0).Control(1).Enabled=   0   'False
  69.          Tab(0).Control(2)=   "List2"
  70.          Tab(0).Control(2).Enabled=   0   'False
  71.          Tab(0).Control(3)=   "List3"
  72.          Tab(0).Control(3).Enabled=   0   'False
  73.          Tab(0).ControlCount=   4
  74.          TabCaption(1)   =   "Message"
  75.          TabPicture(1)   =   "WebServer.frx":0326
  76.          Tab(1).ControlEnabled=   0   'False
  77.          Tab(1).Control(0)=   "Label11"
  78.          Tab(1).Control(1)=   "Label15"
  79.          Tab(1).Control(2)=   "List4"
  80.          Tab(1).Control(3)=   "MessageTxt"
  81.          Tab(1).Control(4)=   "Command7"
  82.          Tab(1).Control(5)=   "Command8"
  83.          Tab(1).ControlCount=   6
  84.          TabCaption(2)   =   "Misc."
  85.          TabPicture(2)   =   "WebServer.frx":0342
  86.          Tab(2).ControlEnabled=   0   'False
  87.          Tab(2).Control(0)=   "Label12"
  88.          Tab(2).Control(1)=   "Label13"
  89.          Tab(2).Control(2)=   "Label14"
  90.          Tab(2).Control(3)=   "Shape2"
  91.          Tab(2).Control(4)=   "Label16"
  92.          Tab(2).Control(5)=   "Label17"
  93.          Tab(2).Control(6)=   "MaxSock"
  94.          Tab(2).Control(7)=   "Command10"
  95.          Tab(2).Control(8)=   "Command11"
  96.          Tab(2).Control(9)=   "Command12"
  97.          Tab(2).Control(10)=   "Command13"
  98.          Tab(2).Control(11)=   "SetSocks"
  99.          Tab(2).Control(12)=   "Command15"
  100.          Tab(2).Control(13)=   "Command17"
  101.          Tab(2).Control(14)=   "Timeoutcmd"
  102.          Tab(2).Control(15)=   "Command19"
  103.          Tab(2).Control(16)=   "Command20"
  104.          Tab(2).ControlCount=   17
  105.          Begin VB.CommandButton Command20 
  106.             Caption         =   "?"
  107.             Height          =   255
  108.             Left            =   -71940
  109.             TabIndex        =   65
  110.             Top             =   1140
  111.             Width           =   375
  112.          End
  113.          Begin VB.CommandButton Command19 
  114.             Caption         =   "?"
  115.             Height          =   255
  116.             Left            =   -71940
  117.             TabIndex        =   64
  118.             Top             =   720
  119.             Width           =   375
  120.          End
  121.          Begin VB.CommandButton Timeoutcmd 
  122.             Caption         =   "Off"
  123.             Height          =   255
  124.             Left            =   -72660
  125.             TabIndex        =   62
  126.             Top             =   1140
  127.             Width           =   735
  128.          End
  129.          Begin VB.CommandButton Command17 
  130.             Caption         =   "Off"
  131.             Height          =   255
  132.             Left            =   -72660
  133.             TabIndex        =   61
  134.             Top             =   720
  135.             Width           =   735
  136.          End
  137.          Begin VB.CommandButton Command15 
  138.             Caption         =   "Infinite"
  139.             Height          =   315
  140.             Left            =   -74100
  141.             TabIndex        =   60
  142.             Top             =   2820
  143.             Width           =   675
  144.          End
  145.          Begin VB.CommandButton SetSocks 
  146.             Caption         =   "Set"
  147.             Height          =   315
  148.             Left            =   -74760
  149.             TabIndex        =   59
  150.             Top             =   2820
  151.             Width           =   675
  152.          End
  153.          Begin VB.CommandButton Command13 
  154.             Caption         =   ">"
  155.             Height          =   255
  156.             Left            =   -73740
  157.             TabIndex        =   58
  158.             Top             =   2460
  159.             Width           =   255
  160.          End
  161.          Begin VB.CommandButton Command12 
  162.             Caption         =   ">>"
  163.             Height          =   255
  164.             Left            =   -74100
  165.             TabIndex        =   57
  166.             Top             =   2460
  167.             Width           =   375
  168.          End
  169.          Begin VB.CommandButton Command11 
  170.             Caption         =   "<<"
  171.             Height          =   255
  172.             Left            =   -74460
  173.             TabIndex        =   56
  174.             Top             =   2460
  175.             Width           =   375
  176.          End
  177.          Begin VB.CommandButton Command10 
  178.             Caption         =   "<"
  179.             Height          =   255
  180.             Left            =   -74700
  181.             TabIndex        =   55
  182.             Top             =   2460
  183.             Width           =   255
  184.          End
  185.          Begin VB.TextBox MaxSock 
  186.             Height          =   285
  187.             Left            =   -74400
  188.             Locked          =   -1  'True
  189.             TabIndex        =   54
  190.             Text            =   "Infinite"
  191.             Top             =   2100
  192.             Width           =   615
  193.          End
  194.          Begin VB.CommandButton Command8 
  195.             Caption         =   "Cancel"
  196.             Height          =   375
  197.             Left            =   -72300
  198.             TabIndex        =   50
  199.             Top             =   2820
  200.             Width           =   915
  201.          End
  202.          Begin VB.CommandButton Command7 
  203.             Caption         =   "Send"
  204.             Height          =   375
  205.             Left            =   -74040
  206.             TabIndex        =   49
  207.             Top             =   2820
  208.             Width           =   915
  209.          End
  210.          Begin VB.TextBox MessageTxt 
  211.             Height          =   1635
  212.             Left            =   -72960
  213.             MultiLine       =   -1  'True
  214.             ScrollBars      =   3  'Both
  215.             TabIndex        =   47
  216.             Top             =   960
  217.             Width           =   2415
  218.          End
  219.          Begin VB.ListBox List4 
  220.             Height          =   1815
  221.             ItemData        =   "WebServer.frx":035E
  222.             Left            =   -74820
  223.             List            =   "WebServer.frx":0360
  224.             TabIndex        =   46
  225.             Top             =   780
  226.             Width           =   1815
  227.          End
  228.          Begin VB.ListBox List3 
  229.             Height          =   1815
  230.             ItemData        =   "WebServer.frx":0362
  231.             Left            =   2580
  232.             List            =   "WebServer.frx":0364
  233.             TabIndex        =   43
  234.             Top             =   780
  235.             Width           =   1815
  236.          End
  237.          Begin VB.ListBox List2 
  238.             Height          =   1815
  239.             ItemData        =   "WebServer.frx":0366
  240.             Left            =   180
  241.             List            =   "WebServer.frx":0368
  242.             TabIndex        =   42
  243.             Top             =   780
  244.             Width           =   1815
  245.          End
  246.          Begin VB.Label Label17 
  247.             Caption         =   "Too many loaded winsock controls can casue ""Out of memory"" error and or system halt."
  248.             Height          =   615
  249.             Left            =   -73080
  250.             TabIndex        =   68
  251.             Top             =   2340
  252.             Width           =   2355
  253.          End
  254.          Begin VB.Label Label16 
  255.             Caption         =   "Warning:"
  256.             BeginProperty Font 
  257.                Name            =   "MS Sans Serif"
  258.                Size            =   13.5
  259.                Charset         =   0
  260.                Weight          =   400
  261.                Underline       =   0   'False
  262.                Italic          =   0   'False
  263.                Strikethrough   =   0   'False
  264.             EndProperty
  265.             ForeColor       =   &H000000FF&
  266.             Height          =   375
  267.             Left            =   -72840
  268.             MousePointer    =   2  'Cross
  269.             TabIndex        =   67
  270.             Top             =   1980
  271.             Width           =   1215
  272.          End
  273.          Begin VB.Label Label15 
  274.             Height          =   195
  275.             Left            =   -72900
  276.             TabIndex        =   66
  277.             Top             =   480
  278.             Width           =   975
  279.          End
  280.          Begin VB.Shape Shape2 
  281.             Height          =   1155
  282.             Left            =   -74820
  283.             Top             =   2040
  284.             Width           =   1455
  285.          End
  286.          Begin VB.Label Label14 
  287.             Caption         =   "Winsock Controls:"
  288.             Height          =   195
  289.             Left            =   -74820
  290.             TabIndex        =   53
  291.             Top             =   1680
  292.             Width           =   1455
  293.          End
  294.          Begin VB.Label Label13 
  295.             Caption         =   "Connection Timeout"
  296.             Height          =   255
  297.             Left            =   -74880
  298.             TabIndex        =   52
  299.             Top             =   1200
  300.             Width           =   1515
  301.          End
  302.          Begin VB.Label Label12 
  303.             Caption         =   "/.. Protection"
  304.             Height          =   255
  305.             Left            =   -74820
  306.             TabIndex        =   51
  307.             Top             =   720
  308.             Width           =   1215
  309.          End
  310.          Begin VB.Label Label11 
  311.             Caption         =   "0.0.0.0"
  312.             Height          =   195
  313.             Left            =   -72900
  314.             TabIndex        =   48
  315.             Top             =   720
  316.             Width           =   1995
  317.          End
  318.          Begin VB.Label Label10 
  319.             Caption         =   "Blocked"
  320.             Height          =   195
  321.             Left            =   3120
  322.             TabIndex        =   45
  323.             Top             =   540
  324.             Width           =   795
  325.          End
  326.          Begin VB.Label Label9 
  327.             Caption         =   "Unblocked"
  328.             Height          =   195
  329.             Left            =   540
  330.             TabIndex        =   44
  331.             Top             =   540
  332.             Width           =   1035
  333.          End
  334.       End
  335.    End
  336.    Begin VB.Frame Frame3 
  337.       Height          =   2910
  338.       Left            =   1200
  339.       TabIndex        =   29
  340.       Top             =   300
  341.       Visible         =   0   'False
  342.       Width           =   2415
  343.       Begin VB.PictureBox Picture2 
  344.          AutoRedraw      =   -1  'True
  345.          BackColor       =   &H00800000&
  346.          FillColor       =   &H00FFFFFF&
  347.          BeginProperty Font 
  348.             Name            =   "MS Sans Serif"
  349.             Size            =   8.25
  350.             Charset         =   0
  351.             Weight          =   700
  352.             Underline       =   0   'False
  353.             Italic          =   0   'False
  354.             Strikethrough   =   0   'False
  355.          EndProperty
  356.          ForeColor       =   &H8000000E&
  357.          Height          =   315
  358.          Left            =   0
  359.          ScaleHeight     =   255
  360.          ScaleWidth      =   2355
  361.          TabIndex        =   70
  362.          Top             =   0
  363.          Width           =   2415
  364.       End
  365.       Begin VB.CommandButton Command6 
  366.          Caption         =   "Save IPs"
  367.          Height          =   375
  368.          Left            =   1455
  369.          TabIndex        =   35
  370.          Top             =   2460
  371.          Width           =   795
  372.       End
  373.       Begin VB.CommandButton Command4 
  374.          Caption         =   "Ok"
  375.          Height          =   375
  376.          Left            =   135
  377.          TabIndex        =   34
  378.          Top             =   2460
  379.          Width           =   795
  380.       End
  381.       Begin VB.TextBox Text2 
  382.          Height          =   1035
  383.          Left            =   75
  384.          Locked          =   -1  'True
  385.          MultiLine       =   -1  'True
  386.          ScrollBars      =   2  'Vertical
  387.          TabIndex        =   33
  388.          Top             =   1350
  389.          Width           =   2235
  390.       End
  391.       Begin VB.Label Label8 
  392.          Caption         =   "0"
  393.          Height          =   180
  394.          Left            =   1140
  395.          TabIndex        =   39
  396.          Top             =   900
  397.          Width           =   1200
  398.       End
  399.       Begin VB.Label Label7 
  400.          Caption         =   "Errors:"
  401.          Height          =   210
  402.          Left            =   75
  403.          TabIndex        =   38
  404.          Top             =   900
  405.          Width           =   1050
  406.       End
  407.       Begin VB.Label PagesViewed 
  408.          Caption         =   "0"
  409.          Height          =   195
  410.          Left            =   1140
  411.          TabIndex        =   37
  412.          Top             =   660
  413.          Width           =   1155
  414.       End
  415.       Begin VB.Label BytesSentLb 
  416.          Caption         =   "0"
  417.          Height          =   195
  418.          Left            =   1140
  419.          TabIndex        =   36
  420.          Top             =   420
  421.          Width           =   1215
  422.       End
  423.       Begin VB.Label Label6 
  424.          Caption         =   "IPs:"
  425.          Height          =   255
  426.          Left            =   90
  427.          TabIndex        =   32
  428.          Top             =   1125
  429.          Width           =   435
  430.       End
  431.       Begin VB.Label Label5 
  432.          Caption         =   "Pages Viewed:"
  433.          Height          =   195
  434.          Left            =   75
  435.          TabIndex        =   31
  436.          Top             =   660
  437.          Width           =   1215
  438.       End
  439.       Begin VB.Label Label4 
  440.          Caption         =   "Bytes Sent:"
  441.          Height          =   255
  442.          Left            =   75
  443.          TabIndex        =   30
  444.          Top             =   420
  445.          Width           =   915
  446.       End
  447.    End
  448.    Begin VB.Frame Frame2 
  449.       Height          =   4635
  450.       Left            =   300
  451.       TabIndex        =   20
  452.       Top             =   0
  453.       Visible         =   0   'False
  454.       Width           =   4335
  455.       Begin VB.PictureBox Picture3 
  456.          AutoRedraw      =   -1  'True
  457.          BackColor       =   &H00800000&
  458.          FillColor       =   &H00FFFFFF&
  459.          BeginProperty Font 
  460.             Name            =   "MS Sans Serif"
  461.             Size            =   8.25
  462.             Charset         =   0
  463.             Weight          =   700
  464.             Underline       =   0   'False
  465.             Italic          =   0   'False
  466.             Strikethrough   =   0   'False
  467.          EndProperty
  468.          ForeColor       =   &H00FFFFFF&
  469.          Height          =   315
  470.          Left            =   0
  471.          ScaleHeight     =   255
  472.          ScaleWidth      =   4455
  473.          TabIndex        =   71
  474.          Top             =   60
  475.          Width           =   4515
  476.       End
  477.       Begin VB.CommandButton Command5 
  478.          Caption         =   "Load"
  479.          Height          =   255
  480.          Left            =   2520
  481.          TabIndex        =   27
  482.          Top             =   2940
  483.          Width           =   735
  484.       End
  485.       Begin VB.CommandButton Ok 
  486.          Caption         =   "OK"
  487.          Enabled         =   0   'False
  488.          Height          =   255
  489.          Left            =   2520
  490.          TabIndex        =   26
  491.          Top             =   3720
  492.          Width           =   735
  493.       End
  494.       Begin VB.CommandButton Command3 
  495.          Caption         =   "Default"
  496.          Height          =   375
  497.          Left            =   3120
  498.          TabIndex        =   25
  499.          Top             =   4140
  500.          Width           =   975
  501.       End
  502.       Begin VB.CommandButton Command2 
  503.          Caption         =   "Cancel"
  504.          Height          =   375
  505.          Left            =   1680
  506.          TabIndex        =   24
  507.          Top             =   4140
  508.          Width           =   975
  509.       End
  510.       Begin VB.CommandButton Command1 
  511.          Caption         =   "Set Errors"
  512.          Enabled         =   0   'False
  513.          Height          =   375
  514.          Left            =   240
  515.          TabIndex        =   23
  516.          Top             =   4140
  517.          Width           =   975
  518.       End
  519.       Begin VB.ListBox List1 
  520.          Height          =   1035
  521.          ItemData        =   "WebServer.frx":036A
  522.          Left            =   120
  523.          List            =   "WebServer.frx":036C
  524.          TabIndex        =   22
  525.          Top             =   2940
  526.          Width           =   2295
  527.       End
  528.       Begin VB.TextBox Text1 
  529.          Enabled         =   0   'False
  530.          Height          =   2475
  531.          Left            =   120
  532.          MultiLine       =   -1  'True
  533.          ScrollBars      =   3  'Both
  534.          TabIndex        =   21
  535.          Top             =   360
  536.          Width           =   4095
  537.       End
  538.       Begin VB.Line Line1 
  539.          X1              =   0
  540.          X2              =   4320
  541.          Y1              =   4020
  542.          Y2              =   4020
  543.       End
  544.    End
  545.    Begin VB.CommandButton Hidecmd 
  546.       Caption         =   "Hide Server"
  547.       Height          =   255
  548.       Left            =   960
  549.       TabIndex        =   19
  550.       Top             =   3180
  551.       Width           =   1095
  552.    End
  553.    Begin VB.Frame Frame1 
  554.       Caption         =   "Path..."
  555.       Height          =   3015
  556.       Left            =   480
  557.       TabIndex        =   12
  558.       Top             =   0
  559.       Visible         =   0   'False
  560.       Width           =   3855
  561.       Begin VB.FileListBox File1 
  562.          Height          =   1845
  563.          Left            =   1920
  564.          TabIndex        =   18
  565.          Top             =   240
  566.          Width           =   1815
  567.       End
  568.       Begin VB.DirListBox Dir1 
  569.          Height          =   1440
  570.          Left            =   120
  571.          TabIndex        =   17
  572.          Top             =   600
  573.          Width           =   1815
  574.       End
  575.       Begin VB.DriveListBox Drive1 
  576.          Height          =   315
  577.          Left            =   120
  578.          TabIndex        =   16
  579.          Top             =   240
  580.          Width           =   1815
  581.       End
  582.       Begin VB.CommandButton CancelPath 
  583.          Caption         =   "Cancel"
  584.          Height          =   375
  585.          Left            =   1920
  586.          TabIndex        =   15
  587.          Top             =   2520
  588.          Width           =   975
  589.       End
  590.       Begin VB.CommandButton Okcmd 
  591.          Caption         =   "OK"
  592.          Height          =   375
  593.          Left            =   720
  594.          TabIndex        =   14
  595.          Top             =   2520
  596.          Width           =   975
  597.       End
  598.       Begin VB.TextBox PathText 
  599.          Height          =   285
  600.          Left            =   120
  601.          TabIndex        =   13
  602.          Text            =   "C:\Webserver\index.html"
  603.          Top             =   2160
  604.          Width           =   3495
  605.       End
  606.    End
  607.    Begin MSWinsockLib.Winsock HTTP 
  608.       Index           =   0
  609.       Left            =   360
  610.       Top             =   3000
  611.       _ExtentX        =   741
  612.       _ExtentY        =   741
  613.       _Version        =   327681
  614.       LocalPort       =   80
  615.    End
  616.    Begin VB.Timer Timer1 
  617.       Enabled         =   0   'False
  618.       Index           =   0
  619.       Interval        =   60000
  620.       Left            =   4200
  621.       Top             =   4440
  622.    End
  623.    Begin VB.CommandButton Dissable 
  624.       Caption         =   "Enabled"
  625.       Height          =   255
  626.       Left            =   3480
  627.       TabIndex        =   11
  628.       Top             =   4920
  629.       Width           =   1095
  630.    End
  631.    Begin VB.TextBox cnt2 
  632.       Height          =   285
  633.       Left            =   3240
  634.       Locked          =   -1  'True
  635.       TabIndex        =   9
  636.       Text            =   "0"
  637.       Top             =   3960
  638.       Width           =   1575
  639.    End
  640.    Begin VB.TextBox cnt1 
  641.       Height          =   285
  642.       Left            =   3240
  643.       Locked          =   -1  'True
  644.       TabIndex        =   7
  645.       Text            =   "0"
  646.       Top             =   3360
  647.       Width           =   1575
  648.    End
  649.    Begin VB.CommandButton IPScmd 
  650.       Caption         =   "IPs"
  651.       Height          =   255
  652.       Left            =   2400
  653.       TabIndex        =   5
  654.       Top             =   3180
  655.       Width           =   615
  656.    End
  657.    Begin VB.CommandButton Disconnect 
  658.       Caption         =   "Stop"
  659.       Height          =   375
  660.       Left            =   2400
  661.       TabIndex        =   4
  662.       Top             =   4920
  663.       Width           =   735
  664.    End
  665.    Begin VB.CommandButton Reset 
  666.       Caption         =   "Restet"
  667.       Enabled         =   0   'False
  668.       Height          =   375
  669.       Left            =   1380
  670.       TabIndex        =   3
  671.       Top             =   4920
  672.       Width           =   735
  673.    End
  674.    Begin VB.CommandButton connect 
  675.       Caption         =   "Start"
  676.       Height          =   375
  677.       Left            =   120
  678.       TabIndex        =   2
  679.       Top             =   4920
  680.       Width           =   855
  681.    End
  682.    Begin VB.TextBox IPtxt 
  683.       Height          =   1335
  684.       Left            =   120
  685.       Locked          =   -1  'True
  686.       MultiLine       =   -1  'True
  687.       ScrollBars      =   2  'Vertical
  688.       TabIndex        =   1
  689.       Top             =   3480
  690.       Width           =   3015
  691.    End
  692.    Begin VB.TextBox HTML 
  693.       Height          =   2895
  694.       Left            =   0
  695.       Locked          =   -1  'True
  696.       MultiLine       =   -1  'True
  697.       ScrollBars      =   3  'Both
  698.       TabIndex        =   0
  699.       Top             =   0
  700.       Width           =   4815
  701.    End
  702.    Begin ComctlLib.ProgressBar ProgressBar1 
  703.       Height          =   195
  704.       Left            =   -60
  705.       TabIndex        =   28
  706.       Top             =   2940
  707.       Width           =   4875
  708.       _ExtentX        =   8599
  709.       _ExtentY        =   344
  710.       _Version        =   327682
  711.       Appearance      =   1
  712.    End
  713.    Begin VB.Label Label3 
  714.       Caption         =   "Connection Timeout Disabled."
  715.       Height          =   375
  716.       Left            =   3420
  717.       TabIndex        =   10
  718.       Top             =   4440
  719.       Width           =   1335
  720.    End
  721.    Begin VB.Shape Shape1 
  722.       Height          =   975
  723.       Left            =   3240
  724.       Top             =   4320
  725.       Width           =   1575
  726.    End
  727.    Begin VB.Label Label2 
  728.       Caption         =   "Current Connections"
  729.       Height          =   255
  730.       Left            =   3240
  731.       TabIndex        =   8
  732.       Top             =   3720
  733.       Width           =   1575
  734.    End
  735.    Begin VB.Label Label1 
  736.       Caption         =   "Connections made"
  737.       Height          =   255
  738.       Left            =   3240
  739.       TabIndex        =   6
  740.       Top             =   3120
  741.       Width           =   1455
  742.    End
  743.    Begin VB.Menu File 
  744.       Caption         =   "File"
  745.       Begin VB.Menu Connect1 
  746.          Caption         =   "Start"
  747.       End
  748.       Begin VB.Menu Disconnect1 
  749.          Caption         =   "Stop"
  750.       End
  751.       Begin VB.Menu MyIP 
  752.          Caption         =   "My IP"
  753.       End
  754.       Begin VB.Menu Exit 
  755.          Caption         =   "Exit"
  756.       End
  757.    End
  758.    Begin VB.Menu Code 
  759.       Caption         =   "Code"
  760.       Begin VB.Menu PathMenu 
  761.          Caption         =   "Path"
  762.       End
  763.       Begin VB.Menu Errors404 
  764.          Caption         =   "HTTP 404 Errors"
  765.       End
  766.       Begin VB.Menu Stats 
  767.          Caption         =   "Stats"
  768.       End
  769.    End
  770.    Begin VB.Menu Security 
  771.       Caption         =   "Security"
  772.       Begin VB.Menu Tabs 
  773.          Caption         =   "Tabs"
  774.       End
  775.    End
  776.    Begin VB.Menu About 
  777.       Caption         =   "About"
  778.       Begin VB.Menu Help 
  779.          Caption         =   "Help"
  780.       End
  781.       Begin VB.Menu Author 
  782.          Caption         =   "Author"
  783.       End
  784.    End
  785.    Begin VB.Menu TrayMenu 
  786.       Caption         =   "TrayMenu"
  787.       Visible         =   0   'False
  788.       Begin VB.Menu Hidemnu 
  789.          Caption         =   "Hide"
  790.       End
  791.       Begin VB.Menu Showmnu 
  792.          Caption         =   "Show"
  793.          Enabled         =   0   'False
  794.       End
  795.       Begin VB.Menu Startmnu 
  796.          Caption         =   "Start"
  797.       End
  798.       Begin VB.Menu Stopmnu 
  799.          Caption         =   "Stop"
  800.          Enabled         =   0   'False
  801.       End
  802.       Begin VB.Menu Exitmnu 
  803.          Caption         =   "Exit"
  804.       End
  805.    End
  806. Attribute VB_Name = "WebServer"
  807. Attribute VB_GlobalNameSpace = False
  808. Attribute VB_Creatable = False
  809. Attribute VB_PredeclaredId = True
  810. Attribute VB_Exposed = False
  811. Dim A As String
  812. Dim AllErrors As String
  813. Dim AllIPs As String
  814. Dim B As String
  815. Dim Blocked_IPs As String
  816. Dim C As String
  817. Dim D As Integer
  818. Dim CodeType As String
  819. Dim Connected As String
  820. Dim ConnectCnt As Integer
  821. Dim ConnectionCounter As Integer
  822. Dim Counter As Integer
  823. Dim Data As String
  824. Dim Error As String
  825. Dim Error1, Error2, Error3, Error4, Error5, Error6, Error1A, Error2A, Error3A, Error4A, Error5A, Error6A As String
  826. Dim Errorcnt As Integer
  827. Dim Final As String
  828. Dim HitCount As String
  829. Dim HtmlIndex As String
  830. Dim HtmlIndexFile As String
  831. Dim i%
  832. Dim IPs As String
  833. Dim IPList As String
  834. Dim Leftty As String
  835. Dim MsgIP As String
  836. Dim Message, msg, Buttons, Title As String
  837. Dim MyPic As String
  838. Dim NewData As String
  839. Dim Oldheight, Diffrence, Newheight As String
  840. Dim OldIPs As String
  841. Dim Oldwidth, WNewwidth, WDiffrence As String
  842. Dim OneIP As String
  843. Dim Request As String
  844. Dim Request1 As String
  845. Dim RequestError As String
  846. Dim Righty As String
  847. Dim Path As String
  848. Dim s%
  849. Dim SlashDot As Integer
  850. Dim SelectedItem As String
  851. Dim SendMsg As Integer
  852. Dim Setup As String
  853. Dim SetInterval As Integer
  854. Dim Socks As String
  855. Dim Stuff As String
  856. Dim Stufftwo As String
  857. Dim ThisMessage As String
  858. Dim TrayMsg As Long
  859. Private Type POINTAPI
  860.         X As Long
  861.         Y As Long
  862. End Type
  863. Private Type mouseptr
  864.   pos As POINTAPI
  865.   xStart As Long
  866.   yStart As Long
  867.   width As Long
  868.   height As Long
  869.   moving As Boolean
  870.   Left As Long
  871.   Top As Long
  872. End Type
  873. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  874. Dim mouse As mouseptr
  875. Option Explicit
  876. 'API constants
  877. Private Const NIM_ADD = &H0
  878. Private Const NIM_MODIFY = &H1
  879. Private Const NIM_DELETE = &H2
  880. Private Const NIF_MESSAGE = &H1
  881. Private Const NIF_ICON = &H2
  882. Private Const NIF_TIP = &H4
  883. Private Const WM_MOUSEMOVE = &H200
  884. Private Const WM_LBUTTONDOWN = &H201     'Button down
  885. Private Const WM_LBUTTONUP = &H202       'Button up
  886. Private Const WM_LBUTTONDBLCLK = &H203   'Double click
  887. Private Const WM_RBUTTONDOWN = &H204     'Button down
  888. Private Const WM_RBUTTONUP = &H205       'Button up
  889. Private Const WM_RBUTTONDBLCLK = &H206   'Double click
  890. Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
  891. Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As Stuff) As Boolean
  892. Private Tray As Stuff
  893. Private Type Stuff
  894.     cbSize As Long
  895.     hwnd As Long
  896.     uId As Long
  897.     uFlags As Long
  898.     MenuMsg As Long
  899.     TIcon As Long
  900.     msgTip As String * 64
  901. End Type
  902. Private Sub Author_Click()
  903. MsgBox "Written by Micah Lansing, 
  904.  2001", vbOKOnly, "Webserver 1.2"
  905. End Sub
  906. Private Sub BytesSentLb_Click()
  907. Frame3.ZOrder 0
  908. End Sub
  909. Private Sub CancelPath_Click()
  910. connect.Enabled = True
  911. Connect1.Enabled = True
  912. Frame1.Visible = False
  913. End Sub
  914. Private Sub Command1_Click()
  915. If D = 1 Then
  916. msg = "Save HTTP 404 Errors?"
  917. Buttons = vbYesNoCancel
  918. Title = "Save?"
  919. Message = MsgBox(msg, Buttons, Title)
  920.     If Message = vbYes Then
  921.     AllErrors = Error1A & " || " & Error2A & " || " & Error3A & " || " & Error4A & " || " & Error5A & " || " & Error6A
  922.         On Error Resume Next
  923.         Kill Path + "\Errors.err" 'deletes old custiom errors
  924.         Open Path + "\Errors.err" For Binary Access Write As #1 'Saves custom errors to a file
  925.             Put 1, , AllErrors
  926.         Close #1
  927.         Error1 = Error1A
  928. Error2 = Error2A
  929. Error3 = Error3A
  930. Error4 = Error4A
  931. Error5 = Error5A
  932. Error6 = Error6A
  933.     End If
  934.     If Message = vbNo Then
  935.     Error1 = Error1A
  936. Error2 = Error2A
  937. Error3 = Error3A
  938. Error4 = Error4A
  939. Error5 = Error5A
  940. Error6 = Error6A
  941.     End If
  942.     If Message = vbCancel Then GoTo 12
  943. End If
  944. Error1 = Error1A
  945. Error2 = Error2A
  946. Error3 = Error3A
  947. Error4 = Error4A
  948. Error5 = Error5A
  949. Error6 = Error6A
  950. Frame2.Visible = False
  951. Command1.Enabled = False
  952. End Sub
  953. Private Sub Command10_Click()
  954.     If MaxSock.Text = "Infinite" Then MaxSock.Text = 5
  955. MaxSock.Text = MaxSock.Text - 1
  956. If MaxSock.Text < 5 Then MaxSock.Text = 5
  957. End Sub
  958. Private Sub Command11_Click()
  959.     If MaxSock.Text = "Infinite" Then MaxSock.Text = 5
  960. MaxSock.Text = MaxSock.Text - 10
  961. If MaxSock.Text < 5 Then MaxSock.Text = 5
  962. End Sub
  963. Private Sub Command12_Click()
  964.     If MaxSock.Text = "Infinite" Then MaxSock.Text = 5
  965. MaxSock.Text = MaxSock.Text + 10
  966. End Sub
  967. Private Sub Command13_Click()
  968.     If MaxSock.Text = "Infinite" Then MaxSock.Text = 5
  969. MaxSock.Text = MaxSock.Text + 1
  970. End Sub
  971. Private Sub Command15_Click()
  972. MaxSock.Text = "Infinite"
  973. Frame4.ZOrder 0
  974. End Sub
  975. Private Sub Command17_Click()
  976. If SlashDot = 0 Then
  977.     SlashDot = 1
  978.     Command17.Caption = "On"
  979.     SlashDot = 0
  980.     Command17.Caption = "Off"
  981. End If
  982. End Sub
  983. Private Sub Command18_Click()
  984. Frame4.Visible = False
  985. End Sub
  986. Private Sub Command19_Click()
  987. MsgBox "/.. Protection stops the client from using /.. to go back a directory on your hard drive.", vbOKOnly, "/.. Protection"
  988. End Sub
  989. Private Sub Command2_Click()
  990. Frame2.Visible = False
  991. End Sub
  992. Private Sub Command20_Click()
  993. MsgBox "Turns on or off a one minute connection timer. If on, connections are only held for one minute before being closed.", vbOKOnly, "Connection Timeout"
  994. End Sub
  995. Private Sub Command3_Click()
  996. DftError
  997. Frame2.Visible = False
  998. End Sub
  999. Private Sub Command4_Click()
  1000. Frame3.Visible = False
  1001. End Sub
  1002. Private Sub Command5_Click()
  1003. Open Path & "\errors.err" For Binary Access Read As #1 'Loads saved custiom errors
  1004.     AllErrors = Space(LOF(1))
  1005.     Get 1, , AllErrors
  1006. Close #1
  1007. If AllErrors = "" Then Kill Path + "/errors.err": Exit Sub
  1008. Error1A = Mid(AllErrors, 1, InStr(1, AllErrors, " || ") - 1)
  1009. AllErrors = Mid(AllErrors, InStr(1, AllErrors, " || ") + 4)
  1010. Error2A = Mid(AllErrors, 1, InStr(1, AllErrors, " || ") - 1)
  1011. AllErrors = Mid(AllErrors, InStr(1, AllErrors, " || ") + 4)
  1012. Error3A = Mid(AllErrors, 1, InStr(1, AllErrors, " || ") - 1)
  1013. AllErrors = Mid(AllErrors, InStr(1, AllErrors, " || ") + 4)
  1014. Error4A = Mid(AllErrors, 1, InStr(1, AllErrors, " || ") - 1)
  1015. AllErrors = Mid(AllErrors, InStr(1, AllErrors, " || ") + 4)
  1016. Error5A = Mid(AllErrors, 1, InStr(1, AllErrors, " || ") - 1)
  1017. AllErrors = Mid(AllErrors, InStr(1, AllErrors, " || ") + 4)
  1018. Error6A = AllErrors
  1019. AllErrors = ""
  1020. Command1.Enabled = True
  1021. D = 0
  1022. Frame2.ZOrder 0
  1023. End Sub
  1024. Private Sub Command6_Click()
  1025. Open Path + "/ServerIpLog.txt" For Binary Access Read Write As #1 'saves IPs to file
  1026.   OldIPs = Space(LOF(1))
  1027.   Get 1, , OldIPs
  1028.   OldIPs = OldIPs & Chr(13) & Chr(10) & "---------------" & Chr(13) & Chr(10) & Text2.Text
  1029.   Put 1, , OldIPs
  1030. Close #1
  1031. Frame4.ZOrder 0
  1032. End Sub
  1033. Private Sub Command7_Click()
  1034. Label15.Caption = "Not yet sent"
  1035. SendMsg = 1
  1036. End Sub
  1037. Private Sub Command8_Click()
  1038. Label15.Caption = ""
  1039. Label11.Caption = "0.0.0.0"
  1040. MessageTxt.Text = ""
  1041. SendMsg = 0
  1042. End Sub
  1043. Private Sub Dir1_Click()
  1044. Frame1.ZOrder 0
  1045. End Sub
  1046. Private Sub Errors404_Click()
  1047. Frame2.Visible = True
  1048. Frame2.ZOrder (0) 'sets frame2 on top
  1049. Frame2.Refresh
  1050. Picture3.CurrentX = 0
  1051. Picture3.CurrentY = 0
  1052. Picture3.Print "HTTP 404 Errors"
  1053. End Sub
  1054. Private Sub Exitmnu_Click()
  1055. Unload Me
  1056. End Sub
  1057. Private Sub File1_Click()
  1058. Frame1.ZOrder 0
  1059. End Sub
  1060. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1061.     'set up the TrayMsg
  1062.     If Me.ScaleMode = vbPixels Then
  1063.         TrayMsg = X
  1064.     Else
  1065.         TrayMsg = X / Screen.TwipsPerPixelX
  1066.     End If
  1067.     Select Case TrayMsg
  1068.         Case WM_RBUTTONUP 'right click
  1069.             Me.PopupMenu TrayMenu
  1070.         Case WM_LBUTTONDBLCLK  'when the left mouse button is dubble clicked
  1071.             Me.Show
  1072.             Me.SetFocus
  1073.             Showmnu.Enabled = False
  1074.             Hidemnu.Enabled = True
  1075.     End Select
  1076. End Sub
  1077. Private Sub Form_Resize()
  1078. On Error Resume Next
  1079. If WebServer.height < 5985 Then
  1080.     WebServer.height = 5985
  1081.     Oldheight = 5985
  1082.     Newheight = Oldheight
  1083.     If WebServer.width < 4980 Then
  1084.         WebServer.width = 4980
  1085.         Oldwidth = 4980
  1086.         WNewwidth = Oldwidth: GoTo 15
  1087.     End If
  1088. GoTo 14
  1089. End If
  1090. If WebServer.width < 4980 Then
  1091.         WebServer.width = 4980
  1092.         Oldwidth = 4980
  1093.         WNewwidth = Oldwidth: GoTo 15
  1094. End If
  1095. Newheight = WebServer.height
  1096. Diffrence = Newheight - Oldheight
  1097. If Diffrence = 0 Then GoTo 14
  1098. connect.Top = connect.Top + Diffrence
  1099. Reset.Top = Reset.Top + Diffrence
  1100. Disconnect.Top = Disconnect.Top + Diffrence
  1101. Dissable.Top = Dissable.Top + Diffrence
  1102. Shape1.Top = Shape1.Top + Diffrence
  1103. IPScmd.Top = IPScmd.Top + Diffrence
  1104. Hidecmd.Top = Hidecmd.Top + Diffrence
  1105. cnt1.Top = cnt1.Top + Diffrence
  1106. cnt2.Top = cnt2.Top + Diffrence
  1107. Label1.Top = Label1.Top + Diffrence
  1108. Label2.Top = Label2.Top + Diffrence
  1109. Label3.Top = Label3.Top + Diffrence
  1110. IPtxt.Top = IPtxt.Top + Diffrence
  1111. ProgressBar1.Top = ProgressBar1.Top + Diffrence
  1112. Frame1.Top = Frame1.Top + (1 / 2 * Diffrence)
  1113. Frame2.Top = Frame2.Top + (1 / 2 * Diffrence)
  1114. Frame3.Top = Frame3.Top + (1 / 2 * Diffrence)
  1115. Frame4.Top = Frame4.Top + (1 / 2 * Diffrence)
  1116. HTML.height = HTML.height + Diffrence
  1117. WNewwidth = WebServer.width
  1118. WDiffrence = WNewwidth - Oldwidth
  1119. If WDiffrence = 0 Then GoTo 15
  1120. If connect.Left < 0 Then GoTo 13
  1121. connect.Left = connect.Left + ((1 / 2 * WDiffrence) - Diffrence)
  1122. Reset.Left = Reset.Left + ((1 / 2 * WDiffrence) - Diffrence)
  1123. Disconnect.Left = Disconnect.Left + ((1 / 2 * WDiffrence) - Diffrence)
  1124. Dissable.Left = Dissable.Left + WDiffrence
  1125. Shape1.Left = Shape1.Left + WDiffrence
  1126. IPScmd.Left = IPScmd.Left + WDiffrence
  1127. Hidecmd.Left = Hidecmd.Left + WDiffrence
  1128. cnt1.Left = cnt1.Left + WDiffrence
  1129. cnt2.Left = cnt2.Left + WDiffrence
  1130. Label1.Left = Label1.Left + WDiffrence
  1131. Label2.Left = Label2.Left + WDiffrence
  1132. Label3.Left = Label3.Left + WDiffrence
  1133. ProgressBar1.width = ProgressBar1.width + WDiffrence
  1134. IPtxt.width = IPtxt.width + WDiffrence
  1135. HTML.width = HTML.width + WDiffrence
  1136. Frame1.Left = Frame1.Left + (1 / 2 * WDiffrence)
  1137. Frame2.Left = Frame2.Left + (1 / 2 * WDiffrence)
  1138. Frame3.Left = Frame3.Left + (1 / 2 * WDiffrence)
  1139. Frame4.Left = Frame4.Left + (1 / 2 * WDiffrence)
  1140. Oldwidth = WNewwidth
  1141. Oldheight = Newheight
  1142. If Shape1.Left < 3240 Then Shape1.Left = 3240
  1143. If Shape1.Left - 840 < 2499 Then
  1144.     connect.Left = 120
  1145.     Disconnect.Left = 2400
  1146.     Reset.Left = 1320
  1147. End If
  1148. If connect.Left < 120 Then connect.Left = 120
  1149. If Disconnect.Left < 2400 Then Disconnect.Left = 2400
  1150. If Reset.Left < 1320 Then Reset.Left = 1320
  1151. End Sub
  1152. Private Sub Form_Unload(Cancel As Integer)
  1153.     Shell_NotifyIcon NIM_DELETE, Tray
  1154. On Error Resume Next
  1155. Unload HelpForm
  1156. End Sub
  1157. Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1158.   mouse.moving = True
  1159.   Call GetCursorPos(mouse.pos)
  1160.   mouse.xStart = mouse.pos.X
  1161.   mouse.yStart = mouse.pos.Y
  1162.   mouse.Left = Frame1.Left
  1163.   mouse.Top = Frame1.Top
  1164.   Frame1.ZOrder 0
  1165. End Sub
  1166. Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1167.   If mouse.moving = True Then
  1168.     Call GetCursorPos(mouse.pos)
  1169.     If Abs(mouse.xStart - mouse.pos.X) > 5 Or Abs(mouse.yStart - mouse.pos.Y) > 5 Then
  1170.       Frame1.Move mouse.Left + (mouse.pos.X - mouse.xStart) * Screen.TwipsPerPixelX, mouse.Top + (mouse.pos.Y - mouse.yStart) * Screen.TwipsPerPixelY
  1171.     Else
  1172.       Frame1.Move mouse.Left, mouse.Top
  1173.     End If
  1174.   End If
  1175. End Sub
  1176. Private Sub Frame1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1177.   mouse.moving = False
  1178.   Picture1.CurrentX = 0
  1179. Picture1.CurrentY = 0
  1180. Picture1.Print "Security"
  1181. Picture2.CurrentX = 0
  1182. Picture2.CurrentY = 0
  1183. Picture2.Print "Stats"
  1184. Picture3.CurrentX = 0
  1185. Picture3.CurrentY = 0
  1186. Picture3.Print "HTTP 404 Errors"
  1187. End Sub
  1188. Private Sub Frame2_Click()
  1189. Frame2.ZOrder 0
  1190. End Sub
  1191. Private Sub Frame3_Click()
  1192. Frame3.ZOrder 0
  1193. End Sub
  1194. Private Sub Help_Click()
  1195. HelpForm.Show (vbModeless) 'shows the helpform
  1196. End Sub
  1197. Private Sub Hidecmd_Click()
  1198. Me.Hide 'hides this form
  1199. Hidemnu.Enabled = False
  1200. Showmnu.Enabled = True
  1201. End Sub
  1202. Private Sub Hidemnu_Click()
  1203. Me.Hide
  1204. Hidemnu.Enabled = False
  1205. Showmnu.Enabled = True
  1206. End Sub
  1207. Private Sub HTTP_Error(Index As Integer, ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  1208. 'If there is an error, close or unload the winsock
  1209. If Index <> 0 And Socks = "I" Then
  1210.     Unload HTTP(Index)
  1211.     Unload Timer1(Index)
  1212.     HTTP(Index).Close
  1213. End If
  1214. End Sub
  1215. Private Sub HTTP_SendProgress(Index As Integer, ByVal bytesSent As Long, ByVal bytesRemaining As Long)
  1216. ProgressBar1.Max = bytesRemaining + bytesSent
  1217. ProgressBar1.Value = bytesSent
  1218. If bytesRemaining = 0 Then ProgressBar1.Value = 0
  1219. End Sub
  1220. Private Sub Label12_Click()
  1221. Frame4.ZOrder 0
  1222. End Sub
  1223. Private Sub Label13_Click()
  1224. Frame4.ZOrder 0
  1225. End Sub
  1226. Private Sub Label14_Click()
  1227. Frame4.ZOrder 0
  1228. End Sub
  1229. Private Sub Label16_Click()
  1230. MsgBox "Note: Too many loaded winsock controls can casue 'Out of memory' error and or system halt. Although the more Winsocks you have loaded, the better the server will perform.", vbOKOnly, "Winsock"
  1231. Frame4.ZOrder 0
  1232. End Sub
  1233. Private Sub Label17_Click()
  1234. Frame4.ZOrder 0
  1235. End Sub
  1236. Private Sub Label4_Click()
  1237. Frame3.ZOrder 0
  1238. End Sub
  1239. Private Sub Label5_Click()
  1240. Frame3.ZOrder 0
  1241. End Sub
  1242. Private Sub Label6_Click()
  1243. Frame3.ZOrder 0
  1244. End Sub
  1245. Private Sub Label7_Click()
  1246. Frame3.ZOrder 0
  1247. End Sub
  1248. Private Sub Label8_Click()
  1249. Frame3.ZOrder 0
  1250. End Sub
  1251. Private Sub List1_DblClick()
  1252. SelectedItem = List1.List(List1.ListIndex)
  1253. Select Case SelectedItem
  1254.     Case "Error 1"
  1255.         Text1.Text = Error1A
  1256.     Case "Error 2"
  1257.         Text1.Text = Error2A
  1258.     Case "Error 3"
  1259.         Text1.Text = Error3A
  1260.     Case "Error 4"
  1261.         Text1.Text = Error4A
  1262.     Case "Error 5"
  1263.         Text1.Text = Error5A
  1264.     Case "Error 6"
  1265.         Text1.Text = Error6A
  1266. End Select
  1267. Ok.Enabled = True
  1268. Text1.Enabled = True
  1269. Text1.SetFocus
  1270. List1.Enabled = False
  1271. Frame2.ZOrder 0
  1272. End Sub
  1273. Private Sub List2_DblClick()
  1274. List3.AddItem List2.List(List2.ListIndex)
  1275. Blocked_IPs = Blocked_IPs & List2.List(List2.ListIndex) & " " 'Add the IP to the block list
  1276. List2.RemoveItem (List2.ListIndex)
  1277. Frame4.ZOrder 0
  1278. End Sub
  1279. Private Sub List3_DblClick()
  1280. Dim OneBlocked As String
  1281. Dim AllBlocked As String
  1282. Dim SomeBlocked As String
  1283. List2.AddItem List3.List(List3.ListIndex)
  1284. AllBlocked = Blocked_IPs
  1285. Do 'Adds IPs to list, and makes sure there Isnt any Dubbles
  1286. OneBlocked = Mid(AllBlocked, 1, InStr(1, AllBlocked, " ") - 1)
  1287. AllBlocked = Mid(AllBlocked, InStr(1, AllBlocked, " ") + 1)
  1288. If OneBlocked <> List3.List(List3.ListIndex) Then 'Check to see if the IP matches
  1289.     SomeBlocked = SomeBlocked & OneBlocked & " "
  1290. GoTo 25
  1291. End If
  1292. Loop Until AllBlocked = ""
  1293. Blocked_IPs = SomeBlocked & AllBlocked 'put the new Block list togather
  1294. List3.RemoveItem (List3.ListIndex)
  1295. Frame4.ZOrder 0
  1296. End Sub
  1297. Private Sub List4_DblClick()
  1298. Label11.Caption = List4.List(List4.ListIndex)
  1299. Frame4.ZOrder 0
  1300. End Sub
  1301. Private Sub MessageTxt_Click()
  1302. Frame4.ZOrder 0
  1303. End Sub
  1304. Private Sub MyIP_Click()
  1305. MsgIP = HTTP(0).LocalIP 'gets you computers IP address
  1306. ThisMessage = MsgBox(MsgIP, vbOKOnly, "Your IP is...")
  1307. End Sub
  1308. Private Sub Ok_Click()
  1309. SelectedItem = List1.List(List1.ListIndex)
  1310. Select Case SelectedItem
  1311.     Case "Error 1"
  1312.         Error1A = Text1.Text
  1313.     Case "Error 2"
  1314.         Error2A = Text1.Text
  1315.     Case "Error 3"
  1316.         Error3A = Text1.Text
  1317.     Case "Error 4"
  1318.         Error4A = Text1.Text
  1319.     Case "Error 5"
  1320.         Error5A = Text1.Text
  1321.     Case "Error 6"
  1322.         Error6A = Text1.Text
  1323. End Select
  1324. Command1.Enabled = True
  1325. Ok.Enabled = False
  1326. Text1.Enabled = False
  1327. List1.Enabled = True
  1328. D = 1
  1329. Frame2.ZOrder 0
  1330. End Sub
  1331. Private Sub PagesViewed_Click()
  1332. Frame3.ZOrder 0
  1333. End Sub
  1334. Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1335.   mouse.moving = True
  1336.   Call GetCursorPos(mouse.pos)
  1337.   mouse.xStart = mouse.pos.X
  1338.   mouse.yStart = mouse.pos.Y
  1339.   mouse.Left = Frame4.Left
  1340.   mouse.Top = Frame4.Top
  1341.   Frame4.ZOrder 0
  1342. End Sub
  1343. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1344.  If mouse.moving = True Then
  1345.     Call GetCursorPos(mouse.pos)
  1346.     If Abs(mouse.xStart - mouse.pos.X) > 5 Or Abs(mouse.yStart - mouse.pos.Y) > 5 Then
  1347.       Frame4.Move mouse.Left + (mouse.pos.X - mouse.xStart) * Screen.TwipsPerPixelX, mouse.Top + (mouse.pos.Y - mouse.yStart) * Screen.TwipsPerPixelY
  1348.     Else
  1349.       Frame4.Move mouse.Left, mouse.Top
  1350.     End If
  1351.   End If
  1352. End Sub
  1353. Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1354. mouse.moving = False
  1355. End Sub
  1356. Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1357.   mouse.moving = True
  1358.   Call GetCursorPos(mouse.pos)
  1359.   mouse.xStart = mouse.pos.X
  1360.   mouse.yStart = mouse.pos.Y
  1361.   mouse.Left = Frame3.Left
  1362.   mouse.Top = Frame3.Top
  1363.   Frame3.ZOrder 0
  1364. End Sub
  1365. Private Sub Picture2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1366.  If mouse.moving = True Then
  1367.     Call GetCursorPos(mouse.pos)
  1368.     If Abs(mouse.xStart - mouse.pos.X) > 5 Or Abs(mouse.yStart - mouse.pos.Y) > 5 Then
  1369.       Frame3.Move mouse.Left + (mouse.pos.X - mouse.xStart) * Screen.TwipsPerPixelX, mouse.Top + (mouse.pos.Y - mouse.yStart) * Screen.TwipsPerPixelY
  1370.     Else
  1371.       Frame3.Move mouse.Left, mouse.Top
  1372.     End If
  1373.   End If
  1374. End Sub
  1375. Private Sub Picture2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1376. mouse.moving = False
  1377. End Sub
  1378. Private Sub Picture3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1379.   mouse.moving = True
  1380.   Call GetCursorPos(mouse.pos)
  1381.   mouse.xStart = mouse.pos.X
  1382.   mouse.yStart = mouse.pos.Y
  1383.   mouse.Left = Frame2.Left
  1384.   mouse.Top = Frame2.Top
  1385.   Frame2.ZOrder 0
  1386. End Sub
  1387. Private Sub Picture3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1388.  If mouse.moving = True Then
  1389.     Call GetCursorPos(mouse.pos)
  1390.     If Abs(mouse.xStart - mouse.pos.X) > 5 Or Abs(mouse.yStart - mouse.pos.Y) > 5 Then
  1391.       Frame2.Move mouse.Left + (mouse.pos.X - mouse.xStart) * Screen.TwipsPerPixelX, mouse.Top + (mouse.pos.Y - mouse.yStart) * Screen.TwipsPerPixelY
  1392.     Else
  1393.       Frame2.Move mouse.Left, mouse.Top
  1394.     End If
  1395.   End If
  1396. End Sub
  1397. Private Sub Picture3_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1398. mouse.moving = False
  1399. End Sub
  1400. Private Sub reset_Click()
  1401. 'Reset the server
  1402. HTTP(0).Close
  1403.     Open Path + HtmlIndexFile For Binary Access Read As #1 'Opens index file
  1404.         Data = Space(LOF(1))
  1405.         Get #1, , Data
  1406.         HTML.Text = Data 'sets file data to textbox
  1407.         Close #1
  1408.     NewData = ""
  1409.     IPtxt = ""
  1410.     HTML.Text = Data
  1411. On Error Resume Next
  1412. If Socks = "I" Then
  1413.     For i% = 1 To ConnectCnt 'Unloads winsocks and timers
  1414.       Unload HTTP(i%)
  1415.       Unload Timer1(i%)
  1416.     Next i%
  1417. End If
  1418.     ConnectCnt = 0
  1419.     Counter = 0
  1420.     ConnectionCounter = 0
  1421.     cnt1 = Counter
  1422.     cnt2 = ConnectionCounter
  1423.     HTTP(0).Listen
  1424. End Sub
  1425. Private Sub Connect_Click()
  1426. 'Starts the server
  1427. HTTP(0).Listen
  1428.     Connected = "YES"
  1429.     Connect1.Enabled = False
  1430.     connect.Enabled = False
  1431.     Reset.Enabled = True
  1432.     Disconnect.Enabled = True
  1433.     Disconnect1.Enabled = True
  1434. Command10.Enabled = False
  1435. Command11.Enabled = False
  1436. Command12.Enabled = False
  1437. Command13.Enabled = False
  1438. Startmnu.Enabled = False
  1439. Stopmnu.Enabled = True
  1440. SetSocks.Enabled = False
  1441. Command15.Enabled = False
  1442. PathMenu.Enabled = False
  1443. End Sub
  1444. Private Sub Connect1_Click()
  1445. 'Starts the server
  1446. HTTP(0).Listen
  1447.     Connected = "YES"
  1448.     Connect1.Enabled = False
  1449.     connect.Enabled = False
  1450.     Reset.Enabled = True
  1451.     Disconnect.Enabled = True
  1452.     Disconnect1.Enabled = True
  1453. Command10.Enabled = False
  1454. Command11.Enabled = False
  1455. Command12.Enabled = False
  1456. Command13.Enabled = False
  1457. Startmnu.Enabled = False
  1458. Stopmnu.Enabled = True
  1459. SetSocks.Enabled = False
  1460. Command15.Enabled = False
  1461. PathMenu.Enabled = False
  1462. End Sub
  1463. Private Sub Dir1_Change()
  1464. File1.Path = Dir1
  1465. PathText = Dir1
  1466. End Sub
  1467. Private Sub Disconnect_Click()
  1468. HTTP(0).Close
  1469.     Open Path + HtmlIndexFile For Binary Access Read As #1 'Opens index file
  1470.         Data = Space(LOF(1))
  1471.         Get #1, , Data
  1472.         HTML.Text = Data 'Sets file data to textbox
  1473.         Close #1
  1474.     NewData = ""
  1475.     IPtxt = ""
  1476.     HTML.Text = Data
  1477.     connect.Enabled = True
  1478.     Connect1.Enabled = True
  1479.     Reset.Enabled = False
  1480.     Disconnect.Enabled = False
  1481.     Disconnect1.Enabled = False
  1482.     Stopmnu.Enabled = False
  1483.     Startmnu.Enabled = True
  1484.     Command10.Enabled = True
  1485.     Command11.Enabled = True
  1486.     Command12.Enabled = True
  1487.     Command13.Enabled = True
  1488.     SetSocks.Enabled = True
  1489.     Command15.Enabled = True
  1490. On Error Resume Next
  1491. If Socks = "I" Then
  1492.     For i% = 1 To ConnectCnt 'Unload winsocks and timers
  1493.       HTTP(i%).Close
  1494.       Unload HTTP(i%)
  1495.       Unload Timer1(i%)
  1496.     Next i%
  1497. End If
  1498.     ConnectCnt = 0
  1499.     Counter = 0
  1500.     ConnectionCounter = 0
  1501.     cnt1 = Counter
  1502.     cnt2 = ConnectionCounter
  1503. PathMenu.Enabled = True
  1504. End Sub
  1505. Private Sub Disconnect1_Click()
  1506. HTTP(0).Close
  1507.     Open Path + HtmlIndexFile For Binary Access Read As #1 'opens index file
  1508.         Data = Space(LOF(1))
  1509.         Get #1, , Data
  1510.         HTML.Text = Data 'sets data of index file to textbox
  1511.         Close #1
  1512.     NewData = ""
  1513.     IPtxt = ""
  1514.     HTML.Text = Data
  1515.     connect.Enabled = True
  1516.     Connect1.Enabled = True
  1517.     Startmnu.Enabled = True
  1518.     Stopmnu.Enabled = False
  1519.     Reset.Enabled = False
  1520.     Disconnect.Enabled = False
  1521.     Disconnect1.Enabled = False
  1522.     On Error Resume Next
  1523. If Socks = "I" Then
  1524.     For i% = 1 To ConnectCnt 'Unload winsocks and timers
  1525.         HTTP(i%).Close
  1526.         Unload HTTP(i%)
  1527.         Unload Timer1(i%)
  1528.     Next i%
  1529. End If
  1530.     ConnectCnt = 0
  1531.     Counter = 0
  1532.     ConnectionCounter = 0
  1533.     cnt1 = Counter
  1534.     cnt2 = ConnectionCounter
  1535.     PathMenu.Enabled = True
  1536. End Sub
  1537. Private Sub Dissable_Click()
  1538. If B = 0 Then 'Turns off the connection timeout
  1539. B = 1
  1540. C = 1
  1541. Dissable.Caption = "Enabled"
  1542. Timeoutcmd.Caption = "Off"
  1543. Label3.Caption = "Connection Timeout Disabled."
  1544. Timer1(0).Enabled = False
  1545. Else 'turns on the connection timeout
  1546. Dissable.Caption = "Disable"
  1547. Label3.Caption = "Connection Timeout Enabled."
  1548. Timeoutcmd.Caption = "On"
  1549. Timer1(0).Enabled = True
  1550. C = 0
  1551. B = 0
  1552. End If
  1553. End Sub
  1554. Private Sub Drive1_Change()
  1555. Dir1.Path = Drive1
  1556. End Sub
  1557. Private Sub Exit_Click()
  1558. Unload Me
  1559. End Sub
  1560. Private Sub File1_DblClick()
  1561. PathText.Text = Dir1.Path + "\" + File1.filename
  1562. End Sub
  1563. Private Sub Form_Load()
  1564. With Tray
  1565.         .cbSize = Len(Tray)
  1566.         .hwnd = Me.hwnd
  1567.         .uId = vbNull
  1568.         .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
  1569.         'The callback should be the mousemove event
  1570.         .MenuMsg = WM_MOUSEMOVE
  1571.         .TIcon = Me.Icon
  1572.         'This is the tooltip in the systray
  1573.         .msgTip = "WebServer 1.2" & vbNullChar
  1574.     End With
  1575.     Shell_NotifyIcon NIM_ADD, Tray
  1576. Oldheight = WebServer.height
  1577. Oldwidth = WebServer.width
  1578. B = 1
  1579. C = 0
  1580. Counter = 0
  1581. D = 0
  1582. Errorcnt = 0
  1583. Socks = "I"
  1584. List1.AddItem "Error 1"
  1585. List1.AddItem "Error 2"
  1586. List1.AddItem "Error 3"
  1587. List1.AddItem "Error 4"
  1588. List1.AddItem "Error 5"
  1589. List1.AddItem "Error 6"
  1590. Stufftwo = ""
  1591. Data = ""
  1592. Open "c:\webserver.cfg" For Binary Access Read As #1
  1593.         Setup = Space(LOF(1))
  1594.         Get #1, , Setup 'get the path for the index file out of the config
  1595. Close #1
  1596.         If Setup <> "" Then
  1597.             Path = Setup
  1598.             'get the index file out of the path
  1599.             HtmlIndexFile = Right(Path, Len(Path) - InStrRev(1, Path, "\") + 1)
  1600.             Path = Left(Setup, Len(Setup) - Len(HtmlIndexFile))
  1601.         Else
  1602.             'if there is no path then show frame1 so that the user can specify path
  1603.             Frame1.Visible = True
  1604.         End If
  1605. Randomize Timer
  1606. ConnectCnt = 0
  1607. ConnectionCounter = 0
  1608.     Disconnect.Enabled = False
  1609.     Disconnect1.Enabled = False
  1610. On Error GoTo pe
  1611. Open Path + HtmlIndexFile For Binary Access Read As #1
  1612.         Data = Space(LOF(1)) 'open the index file, set data to textbox
  1613.         Get #1, , Data
  1614.         HTML.Text = Data
  1615.         If Data = "" Then GoTo pe
  1616.         HtmlIndex = Data
  1617.         Close #1
  1618.         
  1619.         HTTP(0).LocalPort = 80 'set the winsock's local port
  1620.         A = 0
  1621. PathText.Text = Path + HtmlIndexFile
  1622. DftError 'run the sub to set the "404 errors"
  1623. GoTo 4
  1624. Frame1.Visible = True
  1625. End Sub
  1626. Private Sub HTTP_Close(Index As Integer)
  1627. 'If the connecion is closed then unload or close the winsock
  1628. If Socks = "I" Then
  1629.   Unload HTTP(Index)
  1630.   Unload Timer1(Index)
  1631. HTTP(Index).Close
  1632. End If
  1633. ConnectionCounter = ConnectionCounter + 1
  1634. cnt2 = ConnectionCounter
  1635. End Sub
  1636. Private Sub HTTP_ConnectionRequest(Index As Integer, ByVal requestID As Long)
  1637. If Socks = "I" Then
  1638.     ConnectCnt = ConnectCnt + 1
  1639.     If ConnectCnt = 32000 Then ConnectCnt = 1
  1640.     Load HTTP(ConnectCnt) 'load another winsock
  1641.     Load Timer1(ConnectCnt) 'load a timer
  1642.     HTTP(ConnectCnt).Accept requestID 'accept the connection request
  1643.      
  1644.          'Checks if the clients IP is in the string, if so, it will not add it again, but if its not. It will add it.
  1645.         If InStr(1, IPList, HTTP(ConnectCnt).RemoteHostIP & " ", vbTextCompare) Then GoTo 24
  1646.             IPList = IPList & HTTP(ConnectCnt).RemoteHostIP & " "
  1647. If InStr(1, Blocked_IPs, HTTP(ConnectCnt).RemoteHostIP & " ", vbTextCompare) Then HTTP(ConnectCnt).Close: Exit Sub
  1648.     For i% = 1 To Socks
  1649.         If HTTP(i%).State = 0 Then
  1650.             HTTP(i%).Accept requestID 'accept the connection request
  1651.          'Checks if the clients IP is in the string, if so, it will not add it again, but if its not. It will add it.
  1652.         If InStr(1, IPList, HTTP(ConnectCnt).RemoteHostIP & " ", vbTextCompare) Then GoTo 23
  1653.             IPList = IPList & HTTP(i%).RemoteHostIP & " "
  1654.             If InStr(1, Blocked_IPs, HTTP(i%).RemoteHostIP & " ", vbTextCompare) Then HTTP(i%).Close: Exit Sub
  1655.             GoTo 22
  1656.         End If
  1657.     Next i%
  1658. End If
  1659.     Counter = Counter + 1
  1660.     ConnectionCounter = ConnectionCounter + 1
  1661.     cnt1 = Counter
  1662.     cnt2 = ConnectionCounter
  1663. End Sub
  1664. Private Sub HTTP_DataArrival(Index As Integer, ByVal bytesTotal As Long)
  1665.         'Sends message if Ip matches the IP selected
  1666.         If HTTP(Index).RemoteHostIP = Label11.Caption And SendMsg = 1 Then SendMsg = 0: Data = MessageTxt.Text: Label15.Caption = "Sent": HTML.Text = MessageTxt.Text: GoTo 9
  1667.         
  1668.         HTTP(Index).GetData NewData, vbString 'Gets the data the client sent
  1669.         IPtxt.Text = NewData 'sets the data to textbox
  1670.         IPScmd.Caption = "IPs"
  1671.         A = 0
  1672.         If NewData = "" Then HTTP_SendComplete (Index): GoTo 3 'If no data was recieved: close winsock and exit the sub
  1673.         Request = Mid(NewData, 5, InStr(5, NewData, " ") - 5) 'Gets requested filename from clients data
  1674.         IPs = IPs + HTTP(ConnectCnt).RemoteHostIP & " => " & Request + Chr(13) + Chr(10) 'Add Clients IP to the list and Its request
  1675.             If Request <> "/" Then
  1676.                 '/.. protection: if "/.." is found in request then server will disregard the request
  1677.                 If InStr(1, Request, "/..", vbTextCompare) And SlashDot = 1 Then Data = "": GoTo 20
  1678.             On Error GoTo pe
  1679.             Open Path + Request For Binary Access Read As #1 'Opens Requested file
  1680.                 On Error GoTo 0
  1681.                 Data = Space(LOF(1))
  1682.                 Get #1, , Data
  1683.                 HTML.Text = Data
  1684.             Close #1
  1685.         If Data = "" Then Kill Path + Request: Call RandomError 'if nothing is in file, kill it and get "404 error"
  1686.     On Error Resume Next
  1687.     Stufftwo = Mid(Request, InStr(5, Request, "."))
  1688. If InStr(Data, LCase("<count>")) <> 0 Then 'if "<count>" is in the data then run the page counter rutine
  1689.        GoTo 6
  1690.     GoTo 7
  1691. End If
  1692. Leftty = Mid(Data, 1, InStr(5, Data, "<count>") - 1) 'takes all data from the left of <count>
  1693. Righty = Mid(Data, InStr(5, Data, "<count>") + 7) 'takes all data from the right of <count>
  1694.         Open Path + Stufftwo + "Count" For Binary Access Read As #1 'Gets the # of hits from the file
  1695.             HitCount = Space(LOF(1))
  1696.             Get #1, , HitCount
  1697.         Close #1
  1698. If HitCount = "" Then HitCount = 1: GoTo 10
  1699. HitCount = HitCount + 1 'adds one to the hit counter
  1700.         Open Path + Stufftwo + "Count" For Binary Access Write As #1
  1701.             Put #1, , HitCount 'Saves HIts
  1702.             Close #1
  1703. Data = Leftty & "This page has been viewed " & HitCount & " times." & Righty 'Puts the data back togather
  1704. Stufftwo = LCase(Stufftwo)
  1705. Select Case Stufftwo 'sets the "Content-Type" so the client knows what kind of data is sent
  1706.     Case ".php"
  1707.         PagesViewed = PagesViewed + 1
  1708.         CodeType = "text/html"
  1709.     Case ".html"
  1710.         PagesViewed = PagesViewed + 1
  1711.         CodeType = "text/html"
  1712.     Case ".jpg"
  1713.         CodeType = "image/jpeg"
  1714.     Case ".gif"
  1715.         CodeType = "image/gif"
  1716.     Case ".zip"
  1717.         CodeType = "aplication/zip"
  1718.     Case ".exe"
  1719.         CodeType = "aplication/exe"
  1720.     Case ".mpg"
  1721.         CodeType = "movie/mpeg"
  1722.     Case Else
  1723.         CodeType = "text/html"
  1724. End Select
  1725.             'Sends data
  1726.             HTTP(Index).SendData "HTTP/1.0 200 OK" & vbCrLf & _
  1727.                                      "Content-Length: " & Len(Data) & vbCrLf & _
  1728.                                      "Content-Type: " & CodeType & vbCrLf & _
  1729.                                      vbCrLf & _
  1730.                                      Data
  1731.         BytesSentLb = BytesSentLb + Len(Data) 'Adds the amount of bytes to the total bytes sent
  1732.         Else 'if request is = to "/" the it sents the index file
  1733.         
  1734.         'If Data = "" Then Call RandomError
  1735.         Open Path + HtmlIndexFile For Binary Access Read As #1 'Opens index file
  1736.             Data = Space(LOF(1))
  1737.             Get #1, , Data
  1738.             HTML.Text = Data
  1739.         Close #1
  1740.                        
  1741. If InStr(Data, LCase("<count>")) <> 0 Then 'Checks for "<count>"
  1742.     GoTo 8
  1743.     GoTo 9
  1744. End If
  1745.     Leftty = Mid(Data, 1, InStr(5, Data, "<count>") - 1) 'takes all data from the left of <count>
  1746.     Righty = Mid(Data, InStr(5, Data, "<count>") + 7) 'takes all data from the right of <count>
  1747.         Open Path + Stuff + "Count" For Binary Access Read As #1 'Gets the # of hits from the file
  1748.             HitCount = Space(LOF(1))
  1749.             Get #1, , HitCount
  1750.         Close #1
  1751. If HitCount = "" Then HitCount = 1: GoTo 11
  1752. HitCount = HitCount + 1 'adds one to the hit counter
  1753.         Open Path + Stuff + "Count" For Binary Access Write As #1
  1754.             Put #1, , HitCount 'Saves # of hits
  1755.         Close #1
  1756. Data = Leftty & "This page has been viewed " & HitCount & " times." & Righty
  1757. Stuff = Mid(HtmlIndexFile, InStr(5, HtmlIndexFile, "."))
  1758. Stuff = LCase(Stuff)
  1759. Select Case Stuff 'sets the "Content-Type" so the client knows what kind of data is sent
  1760.     Case ".php"
  1761.         PagesViewed = PagesViewed + 1
  1762.         CodeType = "text/html"
  1763.     Case ".html"
  1764.         PagesViewed = PagesViewed + 1
  1765.         CodeType = "text/html"
  1766.     Case ".jpg"
  1767.         CodeType = "image/jpeg"
  1768.     Case ".gif"
  1769.         CodeType = "image/gif"
  1770.     Case ".zip"
  1771.         CodeType = "aplication/zip"
  1772.     Case ".exe"
  1773.         CodeType = "aplication/exe"
  1774.     Case ".txt"
  1775.         PagesViewed = PagesViewed + 1
  1776.         CodeType = "text/plain"
  1777.     Case Else
  1778.         CodeType = "text/html"
  1779. End Select
  1780.                 'Sends data to client
  1781.                 HTTP(Index).SendData "HTTP/1.0 200 OK" & vbCrLf & _
  1782.                                      "Content-Length: " & Len(Data) & vbCrLf & _
  1783.                                      "Content-Type: " & CodeType & vbCrLf & _
  1784.                                      vbCrLf & _
  1785.                                      Data
  1786.         BytesSentLb = BytesSentLb + Len(Data) 'Adds the amount of bytes to the total bytes sent
  1787.         End If
  1788.         Exit Sub
  1789. GoTo 3
  1790. RandomError
  1791. GoTo 1
  1792. End Sub
  1793. Private Sub HTTP_SendComplete(Index As Integer)
  1794. 'Once all data has been sent then the winsock needs to be closed
  1795. On Error Resume Next
  1796. HTTP(Index).Close
  1797. If Socks = "I" Then
  1798.     Unload HTTP(Index)
  1799.     Unload Timer1(Index)
  1800. End If
  1801. ConnectionCounter = ConnectionCounter - 1
  1802. cnt2 = ConnectionCounter
  1803. End Sub
  1804. Private Sub RandomError()
  1805. Errorcnt = Errorcnt + 1
  1806. Label8.Caption = Errorcnt
  1807. Error = Int(Rnd * 6) + 1 'selests a random "404 error"
  1808. Select Case Error
  1809. Case 1
  1810. Data = Error1
  1811. Case 2
  1812. Data = Error2
  1813. Case 3
  1814. Data = Error3
  1815. Case 4
  1816. Data = Error4
  1817. Case 5
  1818. Data = Error5
  1819. Case 6
  1820. Data = Error6
  1821. End Select
  1822. HTML.Text = Data
  1823. End Sub
  1824. Private Sub IPScmd_Click()
  1825. If A = 0 Then
  1826.     IPScmd.Caption = "Rqst"
  1827.     IPtxt.Text = IPs
  1828.     A = A + 1
  1829.     IPScmd.Caption = "IPs"
  1830.     IPtxt.Text = NewData
  1831.     A = 0
  1832. End If
  1833. End Sub
  1834. Private Sub Okcmd_Click()
  1835. Connect1.Enabled = True
  1836. connect.Enabled = True
  1837. Path = PathText.Text
  1838. HtmlIndexFile = Right(Path, Len(Path) - InStrRev(1, Path, "\") + 1) 'Cuts the file and extention out of Path
  1839. Path = Left(Path, Len(Path) - Len(HtmlIndexFile))
  1840. Frame1.Visible = False
  1841.          Kill "c:\webserver.cfg"
  1842.          Open "c:\webserver.cfg" For Binary Access Write As #1
  1843.             Put #1, , PathText.Text 'Writes the config file
  1844.          Close #1
  1845.     On Error GoTo pe
  1846.         Open Path + HtmlIndexFile For Binary Access Read As #1
  1847.             Data = Space(LOF(1))
  1848.             Get #1, , Data 'Opens index file, and puts the Data into a textbox
  1849.             If Data = "" Then GoTo pe
  1850.             HTML.Text = Data
  1851.         Close #1
  1852. GoTo 2
  1853. pe: 'Error message if no data in file
  1854. MsgBox "Invalid path\file name, or no Data in file.", vbOKOnly, "Invalid path\file name"
  1855. Close #1
  1856. End Sub
  1857. Private Sub PathMenu_Click()
  1858. Frame1.Visible = True
  1859. Connect1.Enabled = False
  1860. connect.Enabled = False
  1861. Frame1.ZOrder (0)
  1862. End Sub
  1863. Function InStrRev(start As Long, string1 As String, e userse
  1864. .TwipsPerPixelX
  1865. oClose ng, string and ex(0).Enabledunction InStrRev(sd8   ablnction  = ewb3rcnt = E the winsock needs to be List1.Enabled    A CodeType = "image/giaill Path + 5v(sd: " Iefore being closed.", vbOKOnly, "Connection Timeout"
  1866. En= Space(LOF(1))
  1867.   rt 0ct1_C, "ConnecT  rt 0ccaFrame1.VisiblerorCase 3
  1868. Data = Erame1.Vi
  1869. Ifase 3
  1870. Data = Erame1.s the file and eerver.wiSocks = "I" Then
  1871.     5& vbCrcksr, X Atie Sub Label6_Click()
  1872. Frame  a
  1873. End Sror  8 hits
  1874.         CloserCaa2,
  1875.   mouse.moving = True
  1876. ble = True
  1877. 0As Integer)
  1878. Then ProgressBar1.Value = 0dt #1, , Data 'Op"nter = Con4True
  1879. gle, Y As Single)
  1880.   If mo HTingle, Y AKOnly, "Cons15  Cle,6art AsIf mo HTingl" & LnnectionCcksr, X AtectionCcksr,7rt Aons15  Cli 'e
  1881. Stopmnu.ut"
  1882.      aiBar1topmnndomError
  1883. GoTo 1
  1884. End Sub
  1885. Private Sub HTTP_SendComplete("aplication/exe"
  1886.     Case ".mpg"
  1887.         CodeType = "movieTTP(Index)
  1888.     Unload, stle.", vbOKOnly, "Invalid path\file name"
  1889. ble :rivate = As Si1, , Da(sd8   ablnction  = ewb3rcnid path\file name"
  1890. ble :rivate = As Si1, , Da(sd8   ablnctiivate = As Si1, , Da(sd8   ablnctiivate = As Si1
  1891.             = te = As Si1s = salue = 0dt Then GoT Path +blnctiivate = As Si1, , Daen(i1s = 
  1892.      e Error Resume Next
  1893. H      = tsalue =ast
  1894.  , Da(sd8   ablror name, or no Daaivat7   e"
  1895. f(stad        ng = True
  1896. ble = True
  1897. aivaIPs to list, and mme = ce
  1898. Labe , Dar6't, and mm
  1899.   = cablnctio8   ablror name,'List, HTT,'Invalid oi(hift As Integer, X As Single, Y As Single)
  1900. mouse.moving = False
  1901. End Sub
  1902. Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1903.   mouse.moving = True
  1904.   Call GetCursorPos(mouse.pos)
  1905.   mouse.xStart = mouse.pos.X
  1906. rs404_CIntege #1
  1907.  ub Okcmd_Click()
  1908. Co    Kill)
  1909.   mouse     GoTo   askngle, Y As Single)
  1910. mouse.moving = False
  1911. End Sub
  1912.           For ctio8rror5A = Text1.Text
  1913.     Caser ctio8rror5A = Text1.Text
  1914.     Caser ctio8rror5A = Text1.Text
  1915.     Caser ctio8rror5A = Text1.Text
  1916.     Caser ctio8rror5A = Text1.Text
  1917.     Caser ctio8rror5A = Text1.Text
  1918.     Caser ctio8rror5A = Ter ctio    sr5A = Texyg,aser ctio8rror5A = Text1.Text   Ysssssss6 Then GoT Pt"
  1919. En=5A = Text1.Text
  1920.    u = ewb3b  Ysssssss6 TtCb.b  Yssssss=5A = o8rr
  1921.  mo HTinX A ewb3b  Yse #1
  1922.         If Da"oTo 10o8rror5A = Text1.kSi1s ge it.111111)
  1923. mou mme = ce
  1924. PTrue
  1925. A = Text1.: , HitCound e4u
  1926. PTrue
  1927. A = #1
  1928. .l'a (0r
  1929.  mo HTinX A ewbexe"
  1930. clos'adds one r5A = Tin
  1931. MaxSock.Text = MaxSock.Ter cti   s:daxSock.Ter0 sHTinX1s = sa1
  1932. .l'aTinX1s = Scode As Lon(#1, , Data
  1933. s    ablror name, or no Daaivat7   e"
  1934. f(iBar1top+n As Inte a
  1935. s Intege #1
  1936.  ub Okcmdi
  1937. nButton As Integer, Shift As Integer, X As Single, Yton AInteger, X As Sinb  Yss, , Daen(
  1938. Max Label14_Click()
  1939. Frame4.ZOrder 0
  1940. End Sub
  1941. Private Sub Label16_Click()
  1942.  Yss, , 
  1943.  , Da(sd8   ablrorAEr ctio8rrI vbCrcksr, X Sock.Ter0 sHTinX1s = sa1
  1944. .l'aTinX1s = Scode As Lon(#1, , Data     #1
  1945.  u  ablncangle, Y teger, X As Single, YtonTrueta          Lon(#1, ,        hger, p e4vie/mpeg"
  1946. etonTrueta  e e4vrorP & " "
  1947.         Write vate 
  1948. Max4.Z<ororCase 3
  1949. Dat5A = T, HTT,'Inv(sd8   ablrPath + 5v(sd: " Iefore being closed.", vbOKOnly, "C 5v(sd:.", vbOKOnly, "C 5v(sd:.", vb ed.", = TextYucd1(sd:tonTf2uthe IP selected
  1950.         If HTTP(Index).RemoteHostIP = Label = Scodeio    sr5y"1#1
  1951.  ub Okcmde sub to set the "40 dTrueta  e e    k
  1952.  krue3        
  1953.      sub toiRemoteHostIP seleText =2los'adter
  1954.     cntnnection
  1955.      sub toiRemoteHostIP seleText =2los'adter
  1956.     cntnnectiot3'e
  1957.             HTing c         Data = Space(LtoiRemoi0nteable.Ca l12_Click()
  1958. Frame4.ZOrder 0
  1959. EText1.Text
  1960.     Caser ctiode.Ca l12_Clic
  1961. Ifd + 1
  1962.   3t.Enabled =onnect_Clvouse.xStartNia l12_Clic
  1963. Ifd + 1
  1964.   3t.Enabled =onnect_Clvouse.xStartNia l12_Clic
  1965. Ifd + 1
  1966.   3t.Enabled =onnect_Clvous404ck()
  1967. F, X As Si1.Teca3nabled =onnect_Clvous40(sd8   
  1968. ous40d1(sd:tonTf2uthe IP selected
  1969.         If HTTP(Index).RemoteHostIP = Label = Scodeio    s
  1970.       o8rror5jpg"
  1971.         
  1972. 15s S  CloserCaay"1#1
  1973. o HTTii.Enable_Clic
  1974. arror5jpg"
  1975.     s:daxSock.Ter0 k()
  1976. UEnabled =onnic
  1977. arror5jpg"
  1978. 5jpg"
  1979.    3ck.Ter0 k()
  1980. A = Text1
  1981. iy AccesShas been sent then the wn Label = Scode2 mme = c"= Tex:led =onn  
  1982. ous40 the wna(n1
  1983.      the wna(n1
  1984. se(LOFhnaled =3.Left = Frame3.Left + (1
  1985.      the wna(oErro
  1986. 15s S ouse.T= Fram1Frame3.Left pompare)cksr.Remog" "
  1987. 2      3r1.t.Enab
  1988. 2      3r1.tAs #1t.Text
  1989. HtmlIndexFile = Right(Path, Len    ser ctio8rror5A = Text1oiRemoteHostIP seleText =2los'adter
  1990.     cntnnectiot3'e
  1991.             HTing c         Data = Space(LtoiRemoi0nteable.Ca l12_Click()
  1992. Frame4    tmlIndexFile = Right(ame4    tmlIn41the  wna(n1
  1993.  Y M    tm the co&Mi Y M  oh = ta =     'Checks if tthe w      cb, vb dexFile = Righw      cb,Label &Dighw      cb,,n Labehsr,  Else 'if       hger, p e4vieAs #1
  1994.  HTTP_C ock4vieAs #1
  1995.  Hled = False
  1996. End Sub
  1997. P(Reque m7) 'ted =3.16_Cle)
  1998. mouse.moving = False
  1999. End Sub
  2000. Private Sub Picture2_Mo3le)
  2001. mouse.moving =           Pat= False
  2002. eure2_Mo3le)
  2003. mouse.movinb  Data = Space(LtoiRemoi0nteable.Ca l12_Click()
  2004. Frame4.ZOrder 0
  2005. EText1.Text
  2006.     Caser ctiode.Ca l12_Clic
  2007. Ifd + 1
  2008.   3t.Enabled =onnect_Clvouse.xStartNia l12_Clic
  2009. Ifd + 1
  2010.   3t.Enabled =onnect_Clvouse.xStartNia l12_Clic
  2011. Ifd + 1
  2012.   3t.Enabled =onnect_Clvoush = Falsedds one rIfd + 1
  2013.  hwna(
  2014. from>h53ture3.Curre
  2015. from>h53tdds one  + (1
  2016. xt1.i. l12(1
  2017. xt1.i. le  + (1
  2018. abehsr, Bet          Obntr(5rom>hnect_Clvouse.ss6 Ths+uIf So  = Falsedds one rIfd + 1
  2019.  hwna(
  2020. from>h53ture3.Curre
  2021. from>h53tdds one  + (1
  2022. xt1.i. l12(1
  2023. xt1.i. le  + (1
  2024. abehsr, Bet          Obntr(5rom>hnect_Clvouse.ss6 Ths+uIf So  = Falsedds one rIfd + 1
  2025.  hwna(
  2026. from>h53ture3.Curre
  2027. from>h53tdds one  + (1
  2028. xt1.i. l12(1
  2029. y:01hw  'ss6 Ths+uI>b
  2030. "vb dexFile = Righw      cb,Label &Dighw      o (1
  2031. xt1.i. l Sub
  2032.     = S
  2033.